REPORT ZPMR00130.
TABLES SSCRFIELDS.
INCLUDE ZPMR00130_TOP.
INCLUDE ZPMR00130_SCREEN.
INCLUDE ZPMR00130_UPLOAD.
INCLUDE ZPMR00130_DOWNLOAD.
INCLUDE ZPMR00130_CHECK.
INCLUDE ZPMR00130_EDITOR.
INCLUDE ZPMR00130_FORM.
INCLUDE ZPMR00130_AIP.
INCLUDE ZPMR00130_DISPLAY.
INCLUDE ZPMR00130_DISPLAY2.
INCLUDE ZPMR00130_BATCH.

INITIALIZATION.
FUNCTXT-ICON_ID = ICON_PROTOCOL.
FUNCTXT-ICON_TEXT = '查看日志'.
FUNCTXT-QUICKINFO = '查看推送日志'.
SSCRFIELDS-FUNCTXT_01 = FUNCTXT.

AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM EQ 'FC01'.
PERFOEM FRM_DISPLAY2.
ENDIF.

"控制选择面板 文件选择框显隐
AT SELECTION-SCREEN OUTPUT.
REFRESH GT_LIST.
GT_NAME = 'P_SEL3'.
GS_LIST-KEY = '1'.
GS_LIST-TEXT = '创建'.
APPEND GS_LIST TO GT_LIST.

GS_LIST-KEY = '2'.
GS_LIST-TEXT = '更改'.
APPEND GS_LIST TO GT_LIST.

CALL FUNCTION 'VRM_SET_VALUES' EXPORTING
ID = GT_NAME VALUES = GT_LIST.

LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'M1'.
IF P_DOWN = 'X'.
    SCREEN-ACTIVE = 0.
ENDIF.


IF P_UP = 'X'.
    SCREEN-ACTIVE = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.

START-OF-SELECTION.
"若选中下载
IF P_DOWN = 'X'."获取下载路径
    PERFORM FRM_GET_FULLPATH CHANGING GV_FULLPATH GV_PATH GV_NAME.
    "路径为空则退出
    IF GV_FULLPATH IS INITIAL.
        MESSAGE '用户取消操做' TYPE 'S' DISPLAY LIKE 'W'.
        RETURN.
    ENDIF.

    "下载模板
    PERFORM FRM_DOWN USING GV_FULLPATH.
ENDIF.

"若选中上传
IF P_UP = 'X' AND P_PATH IS NOT INITIAL.
    IF P_SEL4 = 'X'.
        PERFORM FRM_UPLOAD_DATA. "上传
        PERFORM FRM_TRANS.
        PERFORM FRM_DISPLAY.
        
    ELSE.
        PERFORM FRM_BATCH.
    ENDIF.

    ELSEIF P_PATH IS INITIAL AND P_UP = 'X'.
        MESSAGE '请选择导入文件' TYPE 'S' DISPLAY LIKE 'W'.
        STOP.
ENDIF.


